package com.xh.java_mybatis_annotation_sql_demo.mapper;

import com.xh.java_mybatis_annotation_sql_demo.entity.TUser;
import org.apache.ibatis.annotations.*;
import java.util.List;

/**
 * @Description:
 * @JDK_Version: 25
 * @Author: 岫珩
 * @Date: 2025/11/21 星期五 15:09
 */
@Mapper
public interface TUserMapper {
    @Select(value = "select id, username, password, email from t_user where id = #{id}")
    TUser selectTUserById(int id);
    @Select(value = "select id, username, password, email from t_user ")
    List<TUser> selectAllTUsers();
    @Insert(value = "insert into t_user(username, password, email) values(#{username}, #{password}, #{email})")
    void insertTUser(TUser tUser);
    @Update(value = "update t_user set username=#{username}, password=#{password}, email=#{email} where username = #{username}")
    void updateTUser(TUser tUser);
    @Delete(value = "delete from t_user where id=#{id}")
    void deleteTUser(int id);

}
